<html>
<head><meta charset="utf-8"><title>RevealAll in MIR optimizations · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html">RevealAll in MIR optimizations</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238600696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238600696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238600696">(May 13 2021 at 09:38)</a>:</h4>
<p>I understand <a href="https://github.com/rust-lang/rust/issues/78442">#78442</a> as caused by a mismatch between the callee body, which is normalized using RevealAll, and the caller which is not. Is there a reason why the MIR is not systematically normalized with RevealAll before optimization passes?</p>



<a name="238600945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238600945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238600945">(May 13 2021 at 09:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="248906">cjgillot</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations/near/238600696">said</a>:</p>
<blockquote>
<p>Is there a reason why the MIR is not systematically normalized with RevealAll before optimization passes?</p>
</blockquote>



<a name="238600950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238600950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238600950">(May 13 2021 at 09:42)</a>:</h4>
<p>that sounds like a good idea actually</p>



<a name="238600971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238600971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238600971">(May 13 2021 at 09:42)</a>:</h4>
<p>RevealAll is only allowed after monomorphization, right?</p>



<a name="238600998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238600998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238600998">(May 13 2021 at 09:42)</a>:</h4>
<p>I think those are actually fairly independent, at least in ctfe</p>



<a name="238601017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238601017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238601017">(May 13 2021 at 09:43)</a>:</h4>
<p>you can still get back TooGeneric even in RevealAll mode</p>



<a name="238601189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238601189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238601189">(May 13 2021 at 09:45)</a>:</h4>
<p>Yeah, just read the docs on <code>ParamEnv::reveal_all()</code>:</p>
<blockquote>
<p>This is suitable for monomorphized, post-typeck environments like codegen or doing optimizations.</p>
</blockquote>



<a name="238601334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238601334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238601334">(May 13 2021 at 09:48)</a>:</h4>
<p>hmm</p>



<a name="238601434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238601434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238601434">(May 13 2021 at 09:48)</a>:</h4>
<p>You want <code>ParamEnv::with_reveal_all_normalized</code></p>



<a name="238610403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll%20in%20MIR%20optimizations/near/238610403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/RevealAll.20in.20MIR.20optimizations.html#238610403">(May 13 2021 at 11:42)</a>:</h4>
<p>I filed <a href="https://github.com/rust-lang/rust/issues/85254">#85254</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>